/**
 * 
 */
package com.oauth.facebook.client.ui;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Widget;
import com.oauth.components.client.ui.HasWidgetInfo;

/**
 * @author asanthan
 * 
 */
public class FacebookInfo extends Composite implements HasWidgetInfo {

	private static FacebookInfoUiBinder uiBinder = GWT.create(FacebookInfoUiBinder.class);

	interface FacebookInfoUiBinder extends UiBinder<Widget, FacebookInfo> {
	}

	@UiField
	MainPanel mainPanel;

	private Image icon;
	private Image image;

	public FacebookInfo() {
		initWidget(uiBinder.createAndBindUi(this));
		FacebookResources resource = GWT.create(FacebookResources.class);
		icon = new Image(resource.icon());
		image = new Image(resource.image());
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.oauth.components.client.ui.WidgetInfo#init()
	 */
	@Override
	public void init() {
		mainPanel.initMainPanel();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.oauth.components.client.ui.WidgetInfo#getName()
	 */
	@Override
	public String getName() {
		return "Facebook";
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.oauth.components.client.ui.WidgetInfo#getIcon()
	 */
	@Override
	public Image getIcon() {
		return icon;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.oauth.components.client.ui.WidgetInfo#getWidgetImage()
	 */
	@Override
	public Image getWidgetImage() {
		return image;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.oauth.components.client.ui.WidgetInfo#getWidgetUI()
	 */
	@Override
	public Widget getWidgetUI() {
		return mainPanel;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.oauth.components.client.ui.HasWidgetInfo#getId()
	 */
	@Override
	public Long getId() {
		return 4l;
	}

}
